package com.test.prolenders.analytics_prolenders.data_sdk_prolenders.services_prolenders;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;

import androidx.core.content.ContextCompat;

import com.google.gson.Gson;
import com.test.prolenders.analytics_prolenders.data_sdk_prolenders.beans_prolenders.ASHdwBn_prolenders;
import com.test.prolenders.analytics_prolenders.data_sdk_prolenders.util_prolenders.ASGeneralUtil_prolenders;
import com.test.prolenders.analytics_prolenders.data_sdk_prolenders.util_prolenders.ASHarewareUtil_prolenders;
import com.test.prolenders.analytics_prolenders.data_sdk_prolenders.util_prolenders.ASNetworkUtil_prolenders;
import com.test.prolenders.analytics_prolenders.data_sdk_prolenders.util_prolenders.ASUtil_prolenders;

public class ASHdwIfo_prolenders {

    public static ASHdwBn_prolenders getDatas(final Context paramContext) {
        ASHdwBn_prolenders bean = new ASHdwBn_prolenders();
        if (PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(paramContext, Manifest.permission.READ_PHONE_STATE)) {
            try {
                bean.setPhoneType(ASGeneralUtil_prolenders.getPhoneType(paramContext));
                bean.setVersionCode(ASGeneralUtil_prolenders.getVersionCode(paramContext));
                bean.setVersionName(ASGeneralUtil_prolenders.getVersionName(paramContext));
                bean.setAoidId(ASGeneralUtil_prolenders.getAndroidID(paramContext));
                bean.setTelephony(ASGeneralUtil_prolenders.getSimOperatorName(paramContext));
                bean.setIsVpn(ASNetworkUtil_prolenders.getVpnState(paramContext));
                bean.setIsPxyPt(ASNetworkUtil_prolenders.getIsWifiProxy(paramContext));
                bean.setIsDebug(ASGeneralUtil_prolenders.getIsDebug(paramContext));
                bean.setSState(ASGeneralUtil_prolenders.getSimCardState(paramContext));
                bean.setRot(ASHarewareUtil_prolenders.getIsRoot(paramContext));
                bean.setPysSize(ASHarewareUtil_prolenders.getPhySicalSize(paramContext));
                bean.setDisplayLanguage(ASGeneralUtil_prolenders.getDisplayLanguage(paramContext));
                bean.setIso3Language(ASGeneralUtil_prolenders.getIso3Language(paramContext));
                bean.setIso3Country(ASGeneralUtil_prolenders.getIso3Country(paramContext));
                bean.setNetworkOperatorName(ASGeneralUtil_prolenders.getSimOperatorName(paramContext));
                bean.setNetworkType(ASGeneralUtil_prolenders.getNetworkType(paramContext));
                bean.setTimeZoneId(ASGeneralUtil_prolenders.getTimeZoneId(paramContext));
                bean.setElapsedRealtime(ASGeneralUtil_prolenders.getElapsedRealtime(paramContext));
                bean.setSensorList(ASHarewareUtil_prolenders.getSensorList(paramContext));
                bean.setLastBootTime(ASGeneralUtil_prolenders.getLastBootTime(paramContext));
                bean.setRootJailbreak(ASHarewareUtil_prolenders.getIsRoot(paramContext));
                bean.setKeyboard(ASHarewareUtil_prolenders.getKeyboard(paramContext));
                bean.setIsSimulator(ASHarewareUtil_prolenders.getIsSimulator(paramContext));
                bean.setDbm(ASHarewareUtil_prolenders.getMobileDbm(paramContext));
                bean.setPhoneNumber(ASGeneralUtil_prolenders.getPhoneNumber(paramContext));

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return bean;
    }

    public static String getZipString(Context paramContext) {
        String zipString = "";
        try {
            ASHdwBn_prolenders infoBean = getDatas(paramContext);
            String result = new Gson().toJson(infoBean).trim();
            zipString = ASUtil_prolenders.stringToGZIP(result);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return zipString;
    }
}
